/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DAOClass;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author Phong
 */
public abstract class Connect {
    private String DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
    private String SERVER_PATH = "jdbc:sqlserver://localhost:1433;databaseName=Examonline;user=sa;password=1";
    private Connection conn = null;
    public Connect()    {
    }
    public Connection getConnect()  {
        try {
            Class.forName(DRIVER);
            conn = DriverManager.getConnection(SERVER_PATH);
            
        } catch (ClassNotFoundException ex) {
            ex.getMessage();
        } catch (SQLException ex) {
            ex.getMessage();
        }
        return conn;
    }


    /*public static void main(String[] args)
    {
    Connect c = new Connect();
    Connection ck  = c.getConnect();
    System.out.println("Conenct successful");
    }*/
}
